﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Yipusoft.Account.Model;

public partial class DaDuHome : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //BindMenu();
        }
    }

    //void BindMenu()
    //{
    //    //slb
    //    string DepartmentId = Yipusoft.Account.BLL.User.GetUser(User.Identity.Name).DepartmentID;
    //    List<DepartmentInfo> list = Yipusoft.Account.BLL.Department.GetList(" DepartmentId like '" + DepartmentId.Substring(0, 4) + "01_' and DepartmentId<>'" + DepartmentId.Substring(0, 4) + "010' ");
    //    for (int i = 0; i < list.Count; i++)
    //    {
    //        string Name = list[i].ShortName.Length <= 3 ? list[i].ShortName : list[i].ShortName.Substring(3, list[i].ShortName.Length - 3);
    //        slbMenu.Items.Add(new MenuItem(Name, list[i].DepartmentID));
    //    }
    //    if (slbMenu.Items.Count > 0)
    //    {
    //        slbMenu.Items[0].Selected = true;
    //    }

    //    //政治处
    //    list = Yipusoft.Account.BLL.Department.GetList(" DepartmentId like '" + DepartmentId.Substring(0, 4) + "02_' and DepartmentId<>'" + DepartmentId.Substring(0, 4) + "020' ");
    //    for (int i = 0; i < list.Count; i++)
    //    {
    //        string Name = list[i].ShortName.Length <= 3 ? list[i].ShortName : list[i].ShortName.Substring(3, list[i].ShortName.Length - 3);
    //        zzcMenu.Items.Add(new MenuItem(Name, list[i].DepartmentID));
    //    }
    //    if (zzcMenu.Items.Count > 0)
    //    {
    //        zzcMenu.Items[0].Selected = true;
    //    }
    //    //后勤处
    //    list = Yipusoft.Account.BLL.Department.GetList(" DepartmentId like '" + DepartmentId.Substring(0, 4) + "03_' and DepartmentId<>'" + DepartmentId.Substring(0, 4) + "030' ");
    //    for (int i = 0; i < list.Count; i++)
    //    {
    //        string Name = list[i].ShortName.Length <= 3 ? list[i].ShortName : list[i].ShortName.Substring(3, list[i].ShortName.Length - 3);
    //        hqcMenu.Items.Add(new MenuItem(Name, list[i].DepartmentID));
    //    }
    //    if (hqcMenu.Items.Count > 0)
    //    {
    //        hqcMenu.Items[0].Selected = true;
    //    }
    //    //防火处
    //    list = Yipusoft.Account.BLL.Department.GetList(" DepartmentId like '" + DepartmentId.Substring(0, 4) + "04_' and DepartmentId<>'" + DepartmentId.Substring(0, 4) + "040' ");
    //    for (int i = 0; i < list.Count; i++)
    //    {
    //        string Name = list[i].ShortName.Length <= 3 ? list[i].ShortName : list[i].ShortName.Substring(3, list[i].ShortName.Length - 3);
    //        fhcMenu.Items.Add(new MenuItem(Name, list[i].DepartmentID));
    //    }
    //    if (fhcMenu.Items.Count > 0)
    //    {
    //        fhcMenu.Items[0].Selected = true;
    //    }
    //}

    public string GetDepartment()
    {
        return Yipusoft.Account.BLL.Department.GetDepartment(Yipusoft.Account.BLL.User.GetUser(User.Identity.Name).DepartmentID).FullName;
    }
}
